using System;
using System.Collections.Generic;
using System.Text;

using PH.Map;
using System.Diagnostics;

namespace Hoshimi._Map_._Zone_
{

    // On initialise les bloodstream
    public class StreamZoneTraversal : IZoneTraversal
    {
        // VARIABLES
        protected BloodStream mStream = null;

        // GETTERS & SETTERS
        public BloodStream myStream
        { 
            get { return mStream; } 
            set 
            { 
                #if DEBUG
                Debug.Assert(value != null, "Stream null");
                #endif
                mStream = value; 
            }
        }

        public bool Traversal(ref MapNode node)
        {
            PathFinderStream streamDirection;
            switch(myStream.Direction)
            {  
                case BloodStreamDirection.EstWest:
                    streamDirection = PathFinderStream.EstWest;
                    break;
                case BloodStreamDirection.NorthSouth:
                    streamDirection = PathFinderStream.NorthSouth;
                    break;
                case BloodStreamDirection.SouthNorth:
                    streamDirection = PathFinderStream.SouthNorth;
                    break;
                case BloodStreamDirection.WestEst:
                    streamDirection = PathFinderStream.WestEst;
                    break;
                default:
                    // Normalement on ne passe jamais dans ce code
                    streamDirection = PathFinderStream.NoStream;
                    break;
            }
            node.mStream = (sbyte) streamDirection;
            
            return true;
        }
    }
}
